#!/sbin/sh
# Script for checking prerequisites for OpenSIPS-snmp

BASE="OpenSIPS-base"
LIBSNMP="libnetsnmp.so.15"
TMPLIST="/tmp/.opensipssnmp"

pkginfo | grep -i $BASE > /dev/null

if [ $? -eq 1 ]
then
	echo "OpenSIPS-snmp depends on package OpenSIPS-base which is not installed";
	exit 1;
fi

find / -name $LIBSNMP > $TMPLIST 2>&1
lines=`wc -l /tmp/.opensipssnmp`

if [ $lines = "0" ]
then
	echo "OpenSIPS-snmp depends on NET-SNMP Libraries, which cannot be found on system";
	exit 1;
else
	exit 0;
fi
